<?php
// 审核管理员申请
// 审核通过
$rid = @$_GET['rid'];
if (!empty($rid)){
    $arr = array();
    $sql = "UPDATE `relo_tb` SET status=1,update_time=".time()." WHERE rid= {$rid}";
    my_mysql_query($sql, $arr);
}

// 查询修改
$data = array();
$sql  = "SELECT r.uid as uid,r.rid as rid,(SELECT alias FROM `userinfo_tb` as u WHERE u.uid =r.uid ) as alias,";
$sql .= "(SELECT title FROM `zone_modul_tb` as z WHERE z.zid = r.modulid) as title, modulid,";
$sql .= "create_time FROM `relo_tb` as r WHERE status=0 ORDER BY create_time DESC ";
my_mysql_query($sql, $data);


?>
<style type="text/css">
#table{
    text-align: center;
}
#table1{
    padding-left: 50px;
    text-align: center;
    border-bottom: 1px solid rgb(210,210,210);
}
#table1 input {
    width: 200px;
    height: 20px;
    outline: none;
}
#table td,#table th,
#table1 td,#table1 th{
    padding: 0 15px;
}

#table tr:nth-child(even){
    border-bottom: 1px dotted rgb(210,210,210);
}
.red a:link{
    color: red;
    text-decoration:none;
}
.green a:link{
    color: green;
    text-decoration:none;
}
a:visited{
    text-decoration:none;
}
a:active{
    text-decoration:underline;
}
a:hover {
    text-decoration:underline;
}
td button {
    width: 79px;
    height: 32px;
    color: white;
    font-size: 14px;
    border:none;
    outline:none;
    cursor:pointer;
    background: url(image/agree.png) 0 0 no-repeat;
}
</style>

<table id="table" cellspacing="0">
    <caption><h1>用户状态处理</h1></caption>
    <tr>
        <th>序号</th>
        <th>申请人ID</th>
        <th>申请人名称</th>
        <th>板块ID</th>
        <th>板块名称</th>
        <th>申请时间</th>
        <th>操作</th>
    </tr>

    <?php

    $i=1;
    foreach($data as $moderator){
        echo '<tr>';
        echo '<td>'.$i++.'</td>';
        echo '<td>'.$moderator['uid'].'</td>';
        echo '<td>'.$moderator['alias'].'</td>';
        echo '<td>'.$moderator['modulid'].'</td>';
        echo '<td>'.$moderator['title'].'</td>';
        echo '<td>'.date('Y-m-d H:i:s',$moderator['create_time']).'</td>';
        echo '<td><a href="index.php?action='.$action.'&rid='.$moderator['rid'].'">设置为版主</a></td>';
        echo '</tr>';
    }
    ?>
</table>